namespace DotNetNuke.Services.Log.EventLog
{
    using System;
    using System.Collections;
    using System.Reflection;
    using System.Runtime.CompilerServices;

    public class LogInfoArray : IEnumerable, IList
    {
        private ArrayList arrLogs = new ArrayList();

        public int Add(object objLogInfo)
        {
            //int Add;
            this.arrLogs.Add(RuntimeHelpers.GetObjectValue(objLogInfo));
            //return Add;
            return 0;
        }

        public void Clear()
        {
            this.arrLogs.Clear();
        }

        public bool Contains(object value)
        {
            return this.arrLogs.Contains(RuntimeHelpers.GetObjectValue(value));
        }

        public void CopyTo(Array array, int index)
        {
            this.arrLogs.CopyTo(array, index);
        }

        public IEnumerator GetEnumerator()
        {
            return this.arrLogs.GetEnumerator();
        }

        public IEnumerator GetEnumerator(int index, int count)
        {
            return this.arrLogs.GetEnumerator(index, count);
        }

        public LogInfo GetItem(int Index)
        {
            return (LogInfo) this.arrLogs[Index];
        }

        public int IndexOf(object value)
        {
            return this.arrLogs.IndexOf(RuntimeHelpers.GetObjectValue(value));
        }

        public void Insert(int index, object value)
        {
            this.arrLogs.Insert(index, RuntimeHelpers.GetObjectValue(value));
        }

        public void Remove(object objLogInfo)
        {
            this.arrLogs.Remove(RuntimeHelpers.GetObjectValue(objLogInfo));
        }

        public void RemoveAt(int index)
        {
            this.arrLogs.RemoveAt(index);
        }

        public int Count
        {
            get
            {
                return this.arrLogs.Count;
            }
        }

        public bool IsFixedSize
        {
            get
            {
                return this.arrLogs.IsFixedSize;
            }
        }

        public bool IsReadOnly
        {
            get
            {
                return this.arrLogs.IsReadOnly;
            }
        }

        public bool IsSynchronized
        {
            get
            {
                return this.arrLogs.IsSynchronized;
            }
        }

        public object this[int index]
        {
            get
            {
                return this.arrLogs[index];
            }
            set
            {
                this.arrLogs[index] = RuntimeHelpers.GetObjectValue(value);
            }
        }

        public object SyncRoot
        {
            get
            {
                return this.arrLogs.SyncRoot;
            }
        }
        //public
         int System.Collections.ICollection.Count
        {
            get
            {
                return this.arrLogs.Count;
            }
        }
         //public
         bool System.Collections.ICollection.IsSynchronized
        {
            get
            {
                return this.arrLogs.IsSynchronized;
            }
        }
         //public
         object System.Collections.ICollection.SyncRoot
        {
            get
            {
                return this.arrLogs.SyncRoot;
            }
        }
         //public
         bool System.Collections.IList.IsFixedSize
        {
            get
            {
                return this.arrLogs.IsFixedSize;
            }
        }
         //public
         bool System.Collections.IList.IsReadOnly
        {
            get
            {
                return this.arrLogs.IsReadOnly;
            }
        }

        //public object this[int index]
        //{
        //    get
        //    {
        //        return this.arrLogs[index];
        //    }
        //    set
        //    {
        //        this.arrLogs[index] = RuntimeHelpers.GetObjectValue(value);
        //    }
        //}
    }
}

